import request from '@/config/axios'

// 个人招生简介 VO
export interface MentorProfileVO {
  id: string // 主键
  mentorId: number // 导师ID
  avatar: string // 头像
  phone: string // 招生联系手机号
  email: string // 招生联系邮箱
  research: string // 研究方向
  profile: string // 个人简介
  remark: string // 备注
}

// 个人招生简介 API
export const MentorProfileApi = {
  // 查询个人招生简介分页
  getMentorProfilePage: async (params: any) => {
    return await request.get({ url: `/recruit/mentor-profile/page`, params })
  },

  // 查询个人招生简介详情
  getMentorProfile: async (id: number) => {
    return await request.get({ url: `/recruit/mentor-profile/get?id=` + id })
  },

  // 新增个人招生简介
  createMentorProfile: async (data: MentorProfileVO) => {
    return await request.post({ url: `/recruit/mentor-profile/create`, data })
  },

  // 修改个人招生简介
  updateMentorProfile: async (data: MentorProfileVO) => {
    return await request.put({ url: `/recruit/mentor-profile/update`, data })
  },

  // 删除个人招生简介
  deleteMentorProfile: async (id: number) => {
    return await request.delete({ url: `/recruit/mentor-profile/delete?id=` + id })
  },

  // 导出个人招生简介 Excel
  exportMentorProfile: async (params) => {
    return await request.download({ url: `/recruit/mentor-profile/export-excel`, params })
  },

  // 导师获得个人招生简介
  getMyMentorProfile: async () => {
    return await request.get({ url: `/recruit/mentor-profile/my-profile` })
  },

  // 导师保存个人招生简介
  saveMyMentorProfile: async (data: Partial<MentorProfileVO>) => {
    return await request.put({ url: `/recruit/mentor-profile/save-profile`, data })
  }
}
